<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>权限管理</title>
    <#include "/common/link.ftl">
    <script type="text/javascript">
        $(function () {
            $(".btn-reload").click(function () {
                Swal.fire({
                    title: '重新加载?',
                    text: "You won't be able to revert this!",
                    icon: 'info',
                    showCancelButton: '是',
                    confirmButtonColor: '#3085d6',
                    cancelButtonColor: '#d33',
                    confirmButtonText: '否'
                }).then((result) => {
                    if (result.value) {
                        //点击确认按钮后做的事情
                        var jQuery = $(this).data("id");
                        /*
                                      window.loc ation.href="/department/delete?id="
                        */
                        $.get("/permission/reload",function (data) {
                            if (data.success){

                                window.location.href=data;
                            }
                            else {
                                    Swal.fire({
                                        title: data.msg,
                                        text: "You won't be able to revert this!",
                                        icon: 'danger',
                                        showCancelButton: '是',
                                        confirmButtonColor: '#3085d6',
                                        cancelButtonColor: '#d33',
                                        confirmButtonText: '否'
                                    })

                            }

                        /*else {
                                Swal.fire({
                                    title: data.msg,
                                    text: "You won't be able to revert this!",
                                    icon: 'danger',
                                    showCancelButton: '是',
                                    confirmButtonColor: '#3085d6',
                                    cancelButtonColor: '#d33',
                                    confirmButtonText: '否'
                                })
                            }*/
                        })
                    }
                })
            })
        })
    </script>
</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
    <#include "/common/navbar.ftl">
    <!--菜单回显-->
    <#assign currentMenu="permission"/>
    <#include "/common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>权限管理</h1>
        </section>
        <section class="content">
            <div class="box" >
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/permission/list" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <a href="#" class="btn btn-success btn-reload" style="margin: 10px;">
                        <span class="glyphicon glyphicon-repeat"></span>  重新加载
                    </a>
                </form>
                <div class="box-body table-responsive ">
                <table class="table table-hover table-bordered table-striped" >
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>权限名称</th>
                        <th>权限表达式</th>
                   
                    </tr>
                    </thead>
                    <tbody>
                    <#list pageResult.list as p >
                    <tr>
                        <td>${p.id}</td>
                        <td>${p.name}</td>
                        <td>${p.expression}</td>
                      
                    </tr>
                    </#list>
                    </tbody>
                </table>
                    <#include "/common/page.ftl">
                </div>
            </div>
        </section>
    </div>
    <#include "/common/footer.ftl">
</div>
<#--<script>
    $(".btn-reload").click(function () {
        Swal.fire({
            title: '是否删除?',
            text: "You won't be able to revert this!",
            icon: 'info',
            showCancelButton: '是',
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: '否'
        }).then((result) => {
            if (result.value) {
                //点击确认按钮后做的事情
                var jQuery = $(this).data("id");
                /*
                              window.loc ation.href="/department/delete?id="
                */
                $.get("/permission/reload",function (data) {
                    if (data.success){
                        window.location.reload();
                    }else {
                        Swal.fire({
                            title: data.msg,
                            text: "You won't be able to revert this!",
                            icon: 'danger',
                            showCancelButton: '是',
                            confirmButtonColor: '#3085d6',
                            cancelButtonColor: '#d33',
                            confirmButtonText: '否'
                        })
                    }
                })
            }
        })
    })


</script>-->
</body>
</html>
